Remove unused code, add error address