Fix expression problems if no display field and no primary key is defined