Fixed bootstrap script to be more robust.