Small bugfix, added javadoc