Improve initialization callback behavior, add tests