Exception handling

* Remove redundant clauses
* DRY-up the exception handling structure
* Rename 'f' to 'root'
* Print out classnames of unanticipated exceptions