Add functional tests