added test
Merge pull request #16 from fruux/negotiate-undefined-index

Undefined offset issue