Require set where it's needed. Fixes #808