Fixed bug with invalid classes.