Fix key binding errors

The last fix did not work properly. This fix remedies the problem
correctly.