Javadocs and minor bugfixes