Fix #1370; fix partially #1371