Replace obsolete debug function