Fix ambiguous relations and conditions