Fixed a segmentation fault in the options handling.

There was no space for the last NULL, and the indexing for adding the last
NULL was also wrong and out of scope.
Merge pull request #291 from n0la/bugfix/segfault-options

Fixed a segmentation fault in the options handling.