Changes mostly to do with format.

Plus a few bugs.