Fixed a few issues affecting schema validation