Improve logging / bad error handling