Updated tests and javadoc