Reworked path handling and logging