Code executes without error but fails the last condition.