diff --git a/src/main/java/de/prob2/jupyter/ProBKernel.java b/src/main/java/de/prob2/jupyter/ProBKernel.java
index be18d8a39ede0db79cbabb4ce2c01127a42092e2..57a2a23f92187603731ee2ce84dac0593ef1e63e 100644
--- a/src/main/java/de/prob2/jupyter/ProBKernel.java
+++ b/src/main/java/de/prob2/jupyter/ProBKernel.java
@@ -124,6 +124,7 @@ public final class ProBKernel extends BaseKernel {
 	
 	private static final @NotNull Logger LOGGER = LoggerFactory.getLogger(ProBKernel.class);
 	
+	public static final String LOAD_CELL_MACHINE_NAME = "(machine from Jupyter cell)";
 	private static final @NotNull Pattern COMMAND_PATTERN = Pattern.compile("\\s*(\\:[^\\s]*)(?:\\h*(.*))?", Pattern.DOTALL);
 	private static final @NotNull Pattern MACHINE_CODE_PATTERN = Pattern.compile("MACHINE\\W.*", Pattern.DOTALL);
 	private static final @NotNull Pattern BSYMB_COMMAND_PATTERN = Pattern.compile("\\\\([a-z]+)");
@@ -617,7 +618,7 @@ public final class ProBKernel extends BaseKernel {
 	}
 	
 	private @NotNull List<@NotNull String> formatErrorSource(final @NotNull List<@NotNull String> sourceLines, final @NotNull ErrorItem.Location location) {
-		if (sourceLines.isEmpty()) {
+		if (sourceLines.isEmpty() || (!location.getFilename().isEmpty() && !Paths.get(location.getFilename()).getFileName().toString().equals(LOAD_CELL_MACHINE_NAME + ".mch"))) {
 			return Collections.singletonList(this.errorStyler.primary("// Source code not known"));
 		}
 		
diff --git a/src/main/java/de/prob2/jupyter/commands/LoadCellCommand.java b/src/main/java/de/prob2/jupyter/commands/LoadCellCommand.java
index b0525f60c7e1838f8411eef1e099054590ff722c..b9661e7a3bc880da1522c2be5f15def27ae0e683 100644
--- a/src/main/java/de/prob2/jupyter/commands/LoadCellCommand.java
+++ b/src/main/java/de/prob2/jupyter/commands/LoadCellCommand.java
@@ -80,7 +80,7 @@ public final class LoadCellCommand implements Command {
 		this.proBKernelProvider.get().switchMachine(Paths.get(""), stateSpace -> {
 			stateSpace.changePreferences(preferences);
 			CommandUtils.withSourceCode(body, () ->
-				this.classicalBFactory.create("(machine from Jupyter cell)", body).loadIntoStateSpace(stateSpace)
+				this.classicalBFactory.create(ProBKernel.LOAD_CELL_MACHINE_NAME, body).loadIntoStateSpace(stateSpace)
 			);
 			return new Trace(stateSpace);
 		});