Fix attribute bug on deleting objects.