Some sparsity pattern construction fixes. Still some issues.