Fixed crash in free_array()