Changed behaviour of SchemaGenerator and added test