Bugfix

NullReferenceException when trying to serailize some application
exceptions
Unit tests