Fixed DB validation handling for model generator.