Check against both undefined and null instead of just undefined
Dasherize stylename for output