Bugfixing invalid array access
Merge pull request #27 from wagnert/master

Bugfixing invalid array access