System C batch file and some bug fixing