Added some error logging so a specific issue is less mysterious.