Added some logging, etc