Fixed AgentThread and updated some javadoc