Fix init.sh to work with empty directories