Java 6 compliance, fix tests