stat logging, misc cleanup