BUGFIX: OrientDB specific hacks for queries.