Make sure file gets closed.