Fix key matrix issue