Overhauled the keygrip computation.