Add logging and correct error.