Work in progress: Added several unit tests.