fixed merge of #1635 into 2.2.1