Fixed incorrect check for file existence.