reformat code & catch all nonfatal exceptions, per committer feedback