Fixed bug when Nx=0.