Added code to fix the permissions of the resultant config file.

Configuration files are to be readable by the current user only.