Changes for java 6 compatibility