Updates

Mainly to fix the crash reported in quicksilver/Quicksilver#1726, but I did some clean-up as well.