Fixed error when passing in arrays