Fixes to variable names and minor style

Nothing big in this change, but changes should be deployed ASAP.