Fixed off by one error in array_remove_values