Added logging, fixes issue #3