Fix error reporting for invalid paths