some fixes, more tests and better javadoc
minor change to javadoc