allow conversion of keys with nil values

need to check if a key is present instead of if the key is not nil when converting so that keys with nil values will convert over.