Fix NullPointerException when relative path.