Fixes (and adds test for) rel_path_to bug

'.'.rel_path_to('.') raised UnboundLocalError.