Handle class prefixing on no-js classes properly. Fixes #1031