Make indentation consistent, define a variable used in printing errors, remove an unused helper function.