added a couple more fixes

It should be pretty much ready for GUI implementation