Ensure error being returned to native client

This should fix #350.

Can you verify?