Fix compilation on Java 7
Prevent server lock if levels are not used