Added auto equipment purchase in missions

And other fixes and cleanup