Replace "value is 'string'" comparisons with "value == 'string".

Thanks for the code. Had some strange problems getting "unknown character" errors, turns out that using 'is' for string comparison is unreliable. See http://stackoverflow.com/questions/1504717/why-does-comparing-strings-in-python-using-either-or-is-sometimes-produce for discussion.