Fix and add javadoc comments