lua : fix a bug with returned value of user code not being used properly