Baryon number creation and phase transitions in the early universe