Restored changes from a previous pull request

This is to restore [the changes](https://github.com/DynamoDS/Dynamo/pull/2239) that was lost during a repo recovery.