Fix for warning 4244. Cast to short