Better log error checks