esql_model: More adjustments and fixes. Still a long way to go..