Fix compilation on Java 7 and total server lock

First adds a new method added on JDK 1.7. Second commit fixes a serious bug that causes a total server lock if levels are not used.