Fixed debug messages via print (not via write to sys.stdout)