Added QUIT handle. TODO: Memory leaks
Restored one test case