Returns empty array on empty collection

If the collection is empty there's no sense in continuing, this adds a short circuit to return an empty array if there are no items in the collection.

Fixes broken test from #32