Fixed an open file leak where replayopened and reopened files repeatedly without ever closing them.