style change and bug fix for N=1 case