Fix bug in assignment