Formatting fixes and sanity checks Bug #4263