Really fix #1475 and #1445 this time.