Make the Websockets example compile on Mac OS X

Includes some other little patches (type matching, compiler warnings)