Snow Leopard: Fix a bug and some cleanup