lots of bugfixes, first test:ok