Added lots of tests and removed some aliasing bugs.
Merge branch 'v0.36'