Code cleanup

Whitespace, typos, messiness galore.