declared current_site as global in restore_current_site()
added comment about avoiding php warning generated by WP
corrected reference to $wpdb->siteid