Fix data corruption bug

Caused by having an empty level matrix