Fixed incorrect looping in PeerHandler. New data is now read and checked *before* the loop continues