Check return value from select()

Don't manually quote, or encode strings

Minor documentation fixups