Fixes undeployComponent to cleanup __packageRegistry correctly