Fixed crashes in SMP