Added error checking and logging to Paths