Renamed xf_nNonZeros -> xf_NonZeros and cleaned up some other functions