Fixed segfaulting issue with static_pointer_cast