Using dict(k=v) means the key was always named 'k', as the variable is not interpreted there. Fixes #5801