Added missing typechecks (fixes #57)