python27 preparation and major fixes