some changes in option parser/minor fixes
disabled getopt until bugfix
added missing "$"