javadoc and fxed some minor bugs