Rework errors and remove old variables.