bugfixes from testing