bugfixes to commit #16