harden against undefined keys