Copied from old fork.