Replace works, a few bugs

Bug when item is not valid or replaced item not same as entered value
due to autofill. Index errors exist due to this.