Various code cleanup + warning fixes
Update javadocs