various fixes, closer to getting a test case working...