Add a number of static case tests.

Fix a bug where static components indices' were being migrated when
there are only optional and static components.