Ensure quit is called before runCallback