Cache file fixes to handle data gap corner case