Properly check for file existence.