Improve entity.changed(), it now checks for attachment and inited.