Fix fatal error on --debug option. Cleanup.