fixed bugs introduced by attempt to prevent invalid schemas