Bugfixes to realtime JS