bugfixes, bugfixes and more bugfixes