bugfix in Formula.db_replace