Fixed program saving (#352)