Rework fixes for #1051