Debug type check function

Fixes #96