Fixed compute_keys