Attempt to implement return type check at runtime
Added failing tests