Fixes bug with subschemas