Quick hack to get JDK6 compatibility

Also: API changes (already used, but not yet completely stable)
Fixed again for JDK7