Minor: variable renames, format, constant definitions, assert tweaks.