Fixes javadoc, deprecation and unchecked warnings