Nexus 4 WiFi issues

I just got my first Nexus 4 yesterday and everything works fine apart from WiFi. When I first switched it on I was obviously greeted with the setup process and when it came to connecting to my WiFi it would connect but 'Couldn't establish a reliable connection' when coming to signing into my Google account. Somehow after multiple times trying it finally connected and I was able to get into the phone.

The First thing I did when I was able was to check what version of Android I was running which happened to be 4.2.2 so I checked for updates and my phone found 4.3, approximately 170mb in size which started downloading on its own, but soon it became apparent that there is something wrong with the WiFi on my phone because nothing downloads, connection either times out or my download takes a really really long time.

I have tried factory resets and connecting and disconnecting from my network, I have tried connecting to a friend’s WiFi but it’s just as bad and they have Fibre. It seems like software because I have been able to download stuff but it just takes AGES!!!! After ringing Google and talking to someone who didn't really seem to know much suggests getting a replacement phone, but if it is software and reading who many people are having the same issues on their Nexus 4's is there much point of getting it replaced? 

What can I do that will fix this? 

Thanks in advance, Matt