Fixed unicodeencode error and removed debugging code