Javadoc updated and small bugs fixed