Fixes for #317, #339, #365.
Add css class