Casting error

Fixed casting error made in last commit. (technically a warning, but
they are treated as errors)