Fix some compatibility issues in level.cpp, and possibly also a tiny accuracy improve...