Fixes for grid_check and chemsmoke

Infinite loop fix.
Chemicals were spdeading through windows fix.
APC without cells were giving energy fix.