More fixes + more debug code