Fixed queries based around Date objects (were not previously encoded for queries).