Corrected one minor bug (addToPeerCount) and 2 major bugs