Minor cleaning and debugging