Fixed checkstyle and findbugs errors and some compilation warnings.