Invalid SQL could be created by sorting on an invalid alias, with a field that exists on the model. Fixes #3797
Although clearGroup() does not use $this->_File, it needs to be null-ed so that subsequent write() call do not see stale object.
When dates around midnight were used with interval + 12hr formats, the incorrect meridian was selected. Refs #GH-1237