Additional test and bug fix

Additional test that shows a bug in callback initialization and fix for it.