Fix bug with end of level not being triggered.