Logic fixes for CSS validation