Minor changes and improved javadoc.