Add some debug info, fix pathc matching