Fixed some stupid bugs, come up with checkstyle and a few more