Fixes #4861 -  Added option for debugging output