Fixed Java6 compatibility issues