A couple more fixes for edge-case handling with new sparse/dense code