Fixed classification error and a few other complications