main, parser: bugfixing

Lots of bugs fixed. Too much to remember. Well program works better... ish. Still scratching my head why it segfaults with more than 2 items...