Fix for return type being placed in the wrong place in the types array.

Reviewed by @tolmasky.