Fixed error when converting values in arrays