support unpadded keys correctly