Fix a few bugs with new callback design