backporting fix for #44 to groovy