Fix test case fail
Improve buildscript