Why's a cast necessary here?