Added and retested unit tests