Undo the fix for Trac #3772 and do it a new way