Add better logging for when things go wrong