When formatting an error in the default error handler, include any properties set on the original Error object. Also misc. code cleanup.