Add a cast to silence compiler warnings. (#321978, Andrew Paprocki)