Fixed bugs in args parsing

Mostly ArrayOutOfBouds Exceptions