Reapply #51 after bad merging