Websocket fix

This seems to be a start to fixing the websocket stuff.... more to come, probably.