Fix to properly pass "flags" structure.