Fix logger; add handler for sigterm/sigint