Fix increasing memory usage by irep of class