Fixed bug where error_drift calculation was not correct with negitive clock skew