Fixed DXTx data length calculation.
Improved parsing of command line switches.
Improved error checks.