Modify if statement and update tests accordingly

The if statement that checked the cells to autofill was incomplete in
what it was checking.