added more debug output, new error reply and fixed nginx complex test