Fixed case when class starts or ends with spaces or there are multiple spaces