Fix buffer overrun on malformed old levels