main.c: fixed error reporting and pretty print
Signed-off-by: Oliver Lorenz <olli@olorenz.org>