Fixed returning of a freed value on failure.