function::unbatched: fix various retraction scenarios