Encode appropriate var (follows cc3e9a7)