Putting the test back in and fixing it up a little. Also small defensive...

... change in ERR_Handler.