Fix bugs in default path handling.