Changed the way LOWORD is calculated on 64-bit enbironments, to prevent the arithmetic overflow exception.