Update some error messages related to var functions

After changing from `var` to `ref` for return intent, some error messages no longer made sense. These have been updated.