Properly convert complex return types.

This was an oversight on my part in that big PR. I attached some tests to make sure we don't regress on this.