tests, fixes and javadoc