Fix bug in aggregate file