Fixes from testing plus work on the mainlogic tests