Fix locations for error reporting