Added workaround for LAYOUT_ANY.