Added regression test for functions.