Fixed a bug in schema scanner