faster return for avg of empty arrays

* adding test for avg of empty array