Fixed a barrier bug and a thread decorator bug