Some tweaks to (hopefully) add Java 6 support for Agent.