Added callbacks to calls to toArray().