Fix #1524 & 1527