Fix some exception message settings

Following code does not set 'FOO'.

```ruby
class Foo
  attr_accessor :foo
  foo = 'FOO'
end

Foo.new.foo #=> nil
```