New tests, updated javadoc