Copied from octo-found.