Fixed a variable set in the wrong place
Faster way to check if classes exist