Prevent some more crashes and better log errors instead