Improve Css class methods

I wanted to enable a few pending tests in our test suite, and I discovered a few bugs in the process.