More improvements to leak detector by making it static