Complete fix for #48