PERF: better handling of non-invertible cormat