Further fixes and cleanups (mostly javadocs).