Fix bug when no allocation for obj