several bugfixes, more to come