I'll rebase on master (I probably used an outdated version of this code).