Changed order of mutex init and peer init.