Tweak last value file opening logic