some cleaning
return 0, not -1 when all passed
fix compile error when result is an array