Fixed bug in calcReferencePoints.h