Fix bug with creating the log and pid directories