Adding functional tests