Make custom returner work together with startup states

Fixes #7540