TomA: correct rubbish error handling
TomA: extract common setup in a test