Fix for custom QuerySets.

Ref #123