Fix factory flag parsing + ES integration test