Wrapper for debugging calls

  and few related handy functions