Updated unit tests and corrected various other related issues.