small bugfixes and improvements

Please look at the commit messages.

Regards,
Klaus