writePrefs() doesn't check if prefs file exists before overwriting it

For some reason, writePrefs() seems to indiscriminately create new prefs files instead of checking first to see if the prefs file exists, thus leaving old projects behind in some cases. As a temporary solution, using a try-catch block to see if the file exists first before writing to it is probably the best way to go.