Add some code from Tigerbeetle.