Change error reporting to avoid deprecated errors