Updated with comments by Nicolas.