fixed small bug in _schema_template