Making sure we send debug level output to text file during unittest debug
Adding debug output to help understand issues with the wrapper
Fixing build issue and also a real user bug (which wasn't reported)