Null check for dispose
Added test for default errorhandler
Added test