Fix callback being called twice and make it optional

[closes #1104]