more fixes, almost done