Hide inspect item icons when slot is empty.

Also clean up some code.