GROOVY-6350: fixes NPE and removes the debug code from before