test-harness: bug fix, incorrect bash variable dereference, optional mode argument