Fix bugs when running with one GPU