Fix exit function in test.