Tweaked to prefer no sem class if none specified.