Fix bug in put_file() and __file_invalidate_cache()