Bugfixes and javadoc corrections.