Debug output; some cleanup.