fix overlooked type check in schema, and change test to verify functionality