MANY bugfixes