Bug fix

Fixed bug where changing the save path via the client would cause the
program to break. New path was being written directly into file, however
shorter paths would not use up all the bytes, and leave garbage behind.
No testing was done on longer path names, however fix should account for
them. Also threw in some checks to guard against errors being thrown.