diff --git a/pae2xml.pl b/pae2xml.pl
index aa23e2f2c392a267e25a1e5c5d7672c2d55da9a1..4b7c940c1d069baf28ab063466eab6fe8cd74d1b 100755
--- a/pae2xml.pl
+++ b/pae2xml.pl
@@ -383,10 +383,15 @@ sub parse_notes {
 			</barline>
 ';
       } elsif ($barline =~ /^\/\/$/) {
-        print OUT '			<barline location="right">
-				<bar-style>light-light</bar-style>
+        $type = "light-light";
+        # At the end of a piece use a light-heavy barline
+        if ($notes eq "") {
+          $type = "light-heavy";
+        }
+        print OUT "			<barline location=\"right\">
+				<bar-style>$type</bar-style>
 			</barline>
-';
+";
       }
       print OUT "		</measure>\n";
       reset_measure_attributes ();