Fix detecting correct placement of class opening brackets