Adding checkstyle and fixing warnings