Finish stacktraces and add tests.