Bunch of fixes to the classes