Fix for PHOENIX-1077 in 4.0 branch (fixed by Kyle Buzsaki)