Fix variable name handling in widgets. Fixes #166.