test: fix bugs (scp -l and trap ERR)