fix issue with partial positives

Currently this has a bug where

``` js
var i = indexOf(new Buffer('a'), new Buffer('abc'))
console.log(i)
```

Prints 0 (it should print -1)
This PR fixes this.