Set key type as well.