Made some exception handling corrections.