Fix callback according to remarks by @kkoopa