Fixed a bug with array_set when array_remove was used prior.