Improved handling of array results