Clean up a bunch of spec global variable leaks

Also some formatting changes to highlight when using one 'var' with comma operator