Make sure $data is always an array.