Fixed another place where I ran into a cast exception.