Resolved two issues related to exceptions