Revenue at Lionsgate grew 34% during the studio’s second quarter, but the film and television company still reported a $17.5 million loss.

The earnings come as Lionsgate is preparing to merge with Starz, the pay-television operator behind “Outlander” and “Power.” The company showed $639.5 million in revenue for the three-month period ending in September, up from $476.8 million in the prior-year period. The company got a lift from small-screen hits such as “The Wendy Williams Show” and “Nashville,” as well as films such as “Nerve,” “Deepwater Horizon.” and “Mechanic: Resurrection.”

The company’s loss of 12 cents a share was better than Wall Street’s projected 24 cents a share shortfall. Revenue also beat expectations. Most stock-watchers were expecting Lionsgate to report $553.6 million in revenues.

“We achieved solid revenue gains across our core businesses, highlighted by another strong performance from our Television Group, in what we expect to be the last quarter for which we report Lionsgate financial results on a standalone basis,” said Lionsgate CEO Jon Feltheimer in a statement. “We’re making great progress in planning the integration of Starz and Lionsgate, and next quarter we expect to report combined numbers that will begin to reflect the scope of our vertically integrated global content platform, supported by strong free cash flow generation, and a more diversified income stream.”

Lionsgate fielded a few misses at the box office, among them the costly adventure film “Deepwater Horizon” and “Blair Witch,” but it debuted more films, which drove revenues to $464.4, a 31% improvement in the division. There were seven wide theatrical releases for the period compared with three releases in the prior-year quarter. Television production revenues also improved, rising 43% to $175.1 million.

The heftier film slate is partly responsible for the company’s quarterly losses, because Lionsgate had to book marketing costs associated with more than a half-dozen releases.

Lionsgate expects its $4.4 billion merger with Starz to be completed by the end of the year.