Revised fix for #18