Converted entity stuff to shared_ptr.