set of small fixes

see commit messages.