Fixes custom exception code