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.