Fixing bugs in schema