Fix Issue #10, with gates not initializing correctly.

The issue was this.wallState was always undefined in the loop
closure. This is fixed. We should move this into a better location next.