Prevent repeated lookups of nil-valued keys