[PATCH] fix uint64 underflow