Bunch of fixes + custom classes