Added some fixes to allow code completion to work better.