Fixed hasReplacedWheres method