Minor bug fixes. Major JavaDoc updates