Bug fixes and code completion tests

@monikaprabhu please review the test cases I have added to ```CodeCompletionTests.cs```