Small fix for on_timeout and on_cleanup