Fix missing types logic.

missingTypes.length was greater than zero so the only way it can be
zero immediately afterwards is if splice is called so move the zero
check after the splice.

Despite what istanbul reports this function is covered by the tests.
Merge pull request #317 from hindessm/fix-flows-missing-types-logic

Fix missing types logic.