Better Stacktraces.
Added/corrected unit tests.