Fix cell re-ordering bug