Fix latest commits

ATM: Bug in removing sql data;
ATM: bug in rankingTotal;