Fix uninitialized variables num_channels, elem_size.