Add cmdline parameter to set loglevel.

fixes #255
refs #129
Fix wrong variable reference.

refs #129