Updated some exception handling