Chris's changes, plus some whitespace fixes