Fixed bug which caused WSS connections to fail