fix pac generate error

see error report at  Issue 7892,Issue 7892 and Issue 8177
https://code.google.com/p/goagent/issues/detail?id=7909