Added some logging. Fixes issue #1