Fixed bugs when switching from demo to live