Make sure not to use the return value from array_search in case it is false. It will be typecasted to int(0) and return the first offset of the array. Fixes issue #136