Fix bug when p=1. Addresses #521
Fix bug when p=1. Addresses #521

dhimmel/networkx,aureooms/networkx,RMKD/networkx,blublud/networkx,chrisnatali/networkx,ghdk/networkx,jcurbelo/networkx,aureooms/networkx,sharifulgeo/networkx,ghdk/networkx,aureooms/networkx,kai5263499/networkx,jni/networkx,chrisnatali/networkx,jtorrents/networkx,dmoliveira/networkx,kernc/networkx,jni/networkx,beni55/networkx,jni/networkx,dhimmel/networkx,nathania/networkx,harlowja/networkx,cmtm/networkx,dmoliveira/networkx,andnovar/networkx,SanketDG/networkx,bzero/networkx,ionanrozenfeld/networkx,harlowja/networkx,ltiao/networkx,kernc/networkx,harlowja/networkx,farhaanbukhsh/networkx,chrisnatali/networkx,JamesClough/networkx,kernc/networkx,farhaanbukhsh/networkx,NvanAdrichem/networkx,bzero/networkx,debsankha/networkx,nathania/networkx,sharifulgeo/networkx,yashu-seth/networkx,ionanrozenfeld/networkx,dhimmel/networkx,Sixshaman/networkx,ionanrozenfeld/networkx,jakevdp/networkx,goulu/networkx,sharifulgeo/networkx,jakevdp/networkx,jfinkels/networkx,wasade/networkx,nathania/networkx,michaelpacer/networkx,kai5263499/networkx,blublud/networkx,bzero/networkx,OrkoHunter/networkx,kai5263499/networkx,RMKD/networkx,debsankha/networkx,dmoliveira/networkx,ghdk/networkx,RMKD/networkx,farhaanbukhsh/networkx,tmilicic/networkx,debsankha/networkx,jtorrents/networkx,blublud/networkx,jakevdp/networkx