Fixed crashes, there is still one crash left which is at the time of object deallocation.