Fix callbacks; add debug