Small changes to be java 6 compliant