More error logging when stuff goes wrong