Fix invalid calls of methods in compiler pass