Updated code to make it work

Added additional code from ir-gts-bw to make the code work with the 4th
gen releases instead of the newer versions.