Fixed bug in return of previous value.