Javadoc fixes and misc code cleanup.