make unicode better, and start logging debug statements instead of raising exceptions where appropriate