compile better
a few fixes, const, tests pass again