Handles paths more correctly