Added Javadocs
Fixed some issues.