Clean up for lint; change some stderr to stdout; bug fix