Cleaner fix for #567