#142 Return correct type.

Previously the cast of the object was performed but the return type
didn't reflect that. So surrounding code that needed the cast would
break.