bugfixes from merge