Fixing bugs on the delta query.