Port the changes from 0924a36fa6100ae5110f1f65a160474738013eb6 to the "flexible" theme