I contacted HTC today about the proximity sensor issue and got this reply on factory resetting the phone and wiping the partition. It didn't work for me but I thought I'd post it in case it helps others.
Thank you for contacting HTC Technical Support, Thank you for contacting us. We're committed to delivering a great customer experience. As such, we investigate all reported issues. If a hardware or software change is found to improve a customer experience, it will be deployed according to our standard, required processes. We apologize for any inconvenience you have experienced and appreciate your patience as we work quickly to investigate this issue.
Please, follow the steps below to clear all the cache on the phone; this will restore the phone software, except for the ROM Jelly bean update.
1. Turn the phone off
2. Press and hold the Volume Down key and then briefly press the Power key.
3. When you see the screen with the three Android images, release the Volume Down key.
4. Press the Volume Down key to select Factory Reset.
5. Press the Power key.
6. Navigate to ?Recovery? using volume buttons, then press power to select.
7. The screen will change to display a phone on its back, with the update symbol above it. Momentarily it will change to an image of a phone with a red triangle and exclamation mark.
8. Press and hold volume up then press the power button. You will see something very similar to the example shown below.
e:can?t open /cache/recovery/command
e:/ failed to mount /sdcard (no such file or directory exists)
e:/ failed to mount /sdcard (no such file or directory exists)
e:/ failed to mount /sdcard (no such file or directory exists)
9. A new screen will give you options like Reboot system now, Wipe Cache partition, and Wipe Data/Factory Reset.
10. Navigate to ?Wipe Cache? the volume down button and select with Power.
11. Navigate to ?Reboot Phone? with the volume buttons and select with power.