Improved callback handling to tamp down a few memory leaks