crapload of null checks, and apparently a reformat

sorry for the mixed revision and all the whitespace diff noise :(
get rid of some exception stack traces noising up the log
flailing changes in a blind attempt to get node leaving working