callbacks: improve unit testing and fix bugs uncovered

Signed-off-by: Peter Williams <pwil3058@gmail.com>