some essential bugfixes