The last element of the array is 1 and not -1

This should fix the browser based tests.