The following unit test fails:
public void SingleKeyPropertyGroupWithCriteria()
var orderCounts = db.Orders
.GroupBy(o => o.Customer.CustomerId)
(apologies, I haven't got any results verification in there, but the test fails with NoViableAltException before that at the moment).
Moving the ORDER BY to use g.Count() before the projection also fails.