Added a test

And some logging