One thing that have bitten me in the past is the fact that xargs always runs at least once, even if there are no input. By using the -r / --no-run-if-empty flag, xargs does not run the command if the input does not contain any nonblanks.
One can refer to http://pubs.opengroup.org/onlinepubs/009695399/utilities/xar... for the portable flags.