Fix trying to save ranges if functions are involved.