Fix a bug in using the usToTicks with large values. Make the code proper