Fixed internal type checking bug (#170).