Added 2 unit tests.
Merged with upstream.