When resetting selection, finish reassignment chain and insert a reassignment to idle if the last assignment is temporary - fixes #37.