Fixes warnings, adds javadocs.