Print as string.

Better error handling.

Signed-off-by: Thiago Farina <tfarina@chromium.org>