Clear assignable cache whenever target changes

See second commit for details.