Fixed crashes in setup