JSON output and fixes

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>