Serialization of exceptions fixed

Fixed Serialization of exceptions