Xcode-recommended cast fix.