A more traditional CPP-based fix for #483 / 01dcdeb