Unit tests and bug fixes for merge release
Merge branch 'merge'