Add some callback methods.
Merge pull request #366 from semnil/master

Add some callback methods.