Fix path detection for toolbar