Fix key assign behavior.