Fixed a crash in redstone simulator.