def remove_missing_keys(a, b):
    """Remove keys from a that don't appear in b. Expects both maps to be flat"""
    n = dict()
    for k in b.keys():
        if k in a:
            n[k] = a[k]
    return n