Merge "Fix NPE when there are no non-empty sections"