Fix interface of toggle API - #776