Minor enhancement for dom calculation and error handling
Don't convert None to 'None' when sending data to grep plugins
Better debugging for #4402