Catch SIGTERM in tests.
Implement operator numstr->num.