Added test case for objects returned from functions