Check runtime type before sending it, fixes #143