Fixed command line parameters parsing, added more debug printings