(several bugfixes)