beefed up scalastyle and compiler flags a bit, fixed a bug found by FindBugs