fixed cmd line parsing in the samples (Bug #2717)