added invokeAtgMethod.groovy and fixed other bugs