Cleaner attempt to fix #827

Tentative new way to fix #827