Correcting integer division on SD calculation.