Fixed issues with file I/O in RefinementHistory.