Added new unit and functional tests