Fix catching errors from top-level handlers
Merge remote-tracking branch 'upstream/master'