fix some bugs in assignment, self assignment