Cleaned up get_blog_ids() function.