Fixed java6 compilation incompatibilities