add more debugging stuff (optional - remember to uncomment the log file entry) together with fix for python3 bytes issue