some bugfixes and javadocs