Use size_t cast instead of fixed-length integer cast