Fixed bug in which minor # was overwriting the major buffer.

- Also renamed variables, since this looked like shadowing to a non-js developer