Fixed #1564, #1682