distinguish between empty values and errors
fixed a potential leak happening on a fault path