Defined exception macros and added div by zero test