improved fix script to also work without .git