Fixed bug where code dialog in code plugin wouldn't wouldn't add a proper undo level.