Added checks for NVoxels=0