Fix to close properly websockets connections. Fixes #95.