Add test for and fix #15
Merge pull request #18 from bengourley/subschema-improvements

Add test for and fix #15