Fix a bug when tests fail