Added functional tests