My Nexus 4 has had problems shutting off or halting, requiring hard reboot, or just rebooting and getting stuck in a boot loop due to temporary hardware or software issue.
Upgraded to a Nexus 5 and used a SIM Card Eject Tool to remove the SIM.
The iFixit Sim Eject tool is slightly larger than others I've used, and the pin deformed the Nexus' eject pin opening very slightly. The tool got stuck so that I had to carefully yank it out. I recommend filing the first 5mm of it down a little prior to use.