Fix deprecation warnings for nonzeros.