Fixes #5802: Forward port patches from #5755 to technique version 2.1

http://www.rudder-project.org/redmine/issues/5802