Fixed some bugs with equipping.

Fixed a null pointer exception when no item was selected, as well
as a bug where the old weapon didn't go away.
Also formatting. And now I understand why separating reformatting
and code changes is considered a best practice.