Removed rogue print statement
Encoding for response is ISO-8859-1
Fixed some potential errors

Copy/paste produced dead code sections with potential errors.