Fix path detection for plugins