Fix infinite loop with multiple staff sizes