Debug output and fix

Signed-off-by: Thomas Helmke <thomas.helmke@gmx.de>