Fixed bug in the work around fix for #2350.