Address comments from @ElDeveloper

Also fixes up various other parts of the script