r1699: Formatting update, bugfixes