Proper fix for #1010