Bug fixes and code completion tests

This pull request is in continuation with the previous one. It includes minor bug fixes and test cases for functionality implemented in: https://github.com/DynamoDS/Dynamo/pull/2503.

@monikaprabhu please review the test cases I have added to ```CodeCompletionTests.cs```
Created task, http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-4890 to track this