correct treatment of standalone flag
gracefully handle KeyboardInterrupt