Fixed bug where returning NULL instead of empty array