Fix path calculation in new error location substring