Fix level ordering bug