fix various sign problems to match standard orientation for primal and dual