More fixes + removed debug code