Fix attribute handling bug in validation messages like `required_if`, etc. Fixes #1154.