Several important fixes in key-value propagation algorithms and related code.