javadoc, tests, fixed bugs