Fix for #2240