Fix many small bugs in WS SSL