Fix NPE due to wrong key used for lookup