Add the first test case for the schema source functionality and fix a couple of bugs that got uncovered by that.