Fixed relpath to work even for relative path inputs