Fix for JDK7
Some cleanup