Fix: only export constraint violation for constrained problems.