Bugfix cancel button index

The cancel button doesn't have to be at index 0. For example if you
don't use a cancel button then a normal button will be at index 0.
Merge pull request #1 from D-32/master

Bugfix: cancel button index