[master] Two exception handling related patches