Make callbacks work when called from another callback

Fixes #65.