Fixed bug in test/function