Improved function stubs and added a new test.