various smaller bugfixes