Tighten up the validation of the file name no $ is allowed in the filename
Fixed issue when creating a new file in a subdirectory