bugfixes to finish tests