small bugfixes, still more bugs, will document in todo after this commit.