cherry-pick Tortoise changes onto headless branch

review/merge by @TheBizzle, please