Updated code to comply with Java 1.6.