Path detection bugfix