Removed index-out-of-bound error

Change-Id: I505a9e45c94fa7e6d512bc0f0ea113630ec6aad6
Reviewed-on: http://review.couchbase.org/43019
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>