Fix batch investing from build_portfolio