Fix db connection leak and stats reading bug