fixes in inv. iter. + debug prints