JBTM-1696

Single commit from Weinan's #293