Improve exception handling as suggested by bpindelski