Fixed horrible bug in unregistering commands