Further debug function cleanup