Fix pom.xml
Fix some style issues.
Fix a nullpointer exception hidden by catching exception.
Fix the last warnings in the project.