Fix misc syntax errors in scripts:
Missing double quotes on header generation
Missing dollar sign on env vars in a few places