Fixed some bugs and get peer/connect working