FIxed MAGN5043 and MAGN3842

Remove ToString out of Library search. 
Issue: http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-5043
           http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-3482
@sharadkjaiswal please review it. Thanks
This is a pretty scary change. What does the magic number 0 mean here?