Merging part1
Added nonzero_rows support
fix