Switched a couple of "if !" statements to "unless" statements. Also added backtrace output when an exception occurrs in a handler.