Some improvements to bootrsap code