Rework #1773, add check from #1790