Bug fixes related to using callbacks