Added checks to ensure that a nil key is not passed to a "removeObjectForKey:" method.