Fixed crashes