fixed unicode problems and tweaked logging in