Fix bug causing segfaults when paths are broke