Fix PHP 5.2 compatibility.
Check for empty array.