Fix exception handling

This updates exception syntax to the modern one plus fixes some empty
excepts.