Fixed the wierd memory access error. Realized that the component's ptr
to entity was a duplicate shared ptr. Thus at teardown, the entity was
being deleted twice.