Fixing bootstrap function bugs