Small exception handling fix