Fixing up error logging so that full stack trace can be printed out

Fixes issue #24