Check for __main__ module when saving