Bug fix for empty array.