Simplified checks in _join_css_class and updated test to reflect the change (issue #141).