Fixed JRE 6 compatibility