MODE-2112 Changed the fix for MODE-2104 which did not cover all possible cases.