Improve callback handling.
Merge branch 'master' into develop