Fix AST nodes to code issues (MAGN-836, MAGN-839)

Related Dynamo pull request: https://github.com/ikeough/Dynamo/pull/822