Bug fixes related to levels (hopefully)