Debug class and some other changes