Handle nested generic types from C#

Close #728.