Get rid of b(); .encode('utf8') works fine in most cases.
Fix nits.
Fix 'keys' & 'scan match' with non-unicode strings