Fix bug in building trr