Fixed code for winding connections