Fixed checking for command-line parameters.
Added debug printing for detecting tags.