Fixed two more bugs and updated JavaDocs