Fix bugs in echo.groovy and stub.groovy