more bugfixes to get tests working