Fixed intermitant issues with test not stopping correctly