Second part of fix for #35

I got the same error as in #35, but in the stop method instead of the start method. #36 only converted sys.modules.items() to a list in start, but that also needs to be done in stop.