Fix error when returning Task of a reference type

Thanks to @Blewzman for pointing that out.
Merge pull request #73 from alextercete/bug/reference-type-tasks-throwing-exception

Fix error when returning Task of a reference type