Fix callbacks and add more logging