Fixed extra divide by w bug in Rd calculation