Tweaked some of the code around css class creation.