Added an overload to the delegate version for catching general Exceptions.

Also fixed the style for "if" statements.