Fix test which fails on faster PCs
Fixed behaviour when a callback throws null