Added better error log.