Fixes #10; ensure code not empty after code.clear()