Remove ToString out of Library search. FIxed MAGN5043 and MAGN3842
Change test cases according to changes
Merge pull request #2872 from theanh0512/MAGN5043

FIxed MAGN5043 and MAGN3842