Fixed #1090
Fixed #1101