Make JMS tests more robust against failures (+ some other commits)