Bruins take win after sloppy performance