Fix level issues (reverse-merged from commit b864a209f70e2fb587759cde662ed8f96d75a29a)