Updated functions and mission stack.

Still an annoying bug with mission stack being reset with new types
being added, but easily enough fixed.