Lots of bug fixes.

Many incorrect 'this' refs remain.