some schema fixes and additional patterns, moved validations to schema.py