Added some logging stuff.