This has useful debugging functions; it was left out of the change from the separate thirdparty repo.