Fixed minor bug in function return.