Removed xrange in bootstrap_indexes (note that slightly changes output), and made exception Python3 compatible.