Fix bug where filtering for reverse-related objects wrongly uses a key instead of an id.