XGM optimizations and fixes

fixes ZAS unsim connections filling up, optimizes graphics a bit
this was lying on my tree from a week ago

yep, should have read that better before committing it