Fix incomplete clone, remove unused code, and javadoc