Fix IllegalOperationError when running scratch-flash
Merge pull request #390 from LLK/illegal

Fix IllegalOperationError when running scratch-flash