Fix reassignment bugs