fixed code that checks match between filename and id; more schema fixes