Added a warning message if the returned path has size 0, or if a NullPointerException is thrown.