Don't use empty() to check if array has 0 items

Change-Id: Ia3d8a6882224aa900574d4584411a02fa1884119