Properly convert complex return types.

Attached tests.
Merge pull request #16 from STRML/master

Properly convert complex return types.