Yet another 3 bug fixes.

Bugs numbers are in commits descriptions.