Move debug print inside ifs now that early out was removed

bug 5819