Cleaning up build-index.sh a bit