Fixed query.
Started implementing the groovy model generator.