Fix stacktraces for loaded scripts