Fix unit tests by making callback null safe