Fix small subtle bug in GROUP_BY constraint.

@guenter @krishnap

Commit message should be sufficiently descriptive.
How would throwing a `NoSuchElementException` help in this case? It would probably be a good to add logging if it's `None`, but `Option.get` is an unsafe method that shouldn't even exist.