Changed some Java 7 specific constructs to be Java 6 compatible