Added termination signal, and changed tests