Properly resolve variables used as values.

Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>