Fix #1153 and #1155