Fixed several bugs, no accout matrix yet..

Main mission loop is working fine, some bugs fixed, and some tidying
done.