#3881: Added functional tests.