test for bug #226
algebra: use deep copy during inlining

Fix bug #226
Merge pull request #227 from uwescience/fix-226

Fix #226