Fixed some exception code