Fixes #2. Completed the unit tests