Fix error logging calls