Added missing java doc and more code cleanup. #472