cleanup; fixes; exit/crash handler; dummy ai