increased debug and changed handling of special unicode characters