.attr setting boolean attributes

Fixed setting boolean attributes
This change is untested. I don't think we need another pull request for it, but could you address it in a separate commit and a separate unit test?