Added new test for small ticket numbers and fixed bug when query execution is not complete.