improve type inference in prepConstrMatrix