Tweaked to account for file existence.